﻿using System.Collections.Generic;
using FluentTests.Framework.Verbs;

namespace FluentTest.NUnit.Swedish
{

    public sealed class Försäkra
    {
        private static readonly FluentTests.Framework.IAssertionProvider assertionProvider = new FluentTests.NUnit.NUnitAssertionProvider();

        public static EnsuredWrapper<object> Att(object compareValue)
        {
            return new EnsuredWrapper<object>(assertionProvider, compareValue);
        }

        public static EnsuredWrapper<double> Att(double compareValue)
        {
            return new EnsuredWrapper<double>(assertionProvider, compareValue);
        }

        public static EnsuredWrapper<int> Att(int compareValue)
        {
            return new EnsuredWrapper<int>(assertionProvider, compareValue);
        }

        public static EnsuredWrapper<float > Att(float compareValue)
        {
            return new EnsuredWrapper<float>(assertionProvider, compareValue);
        }

        public static EnsuredWrapper<long> Att(long compareValue)
        {
            return new EnsuredWrapper<long>(assertionProvider, compareValue);
        }

        public static EnsuredWrapper<bool> Att(bool compareValue)
        {
            return new EnsuredWrapper<bool>(assertionProvider, compareValue);
        }

        public static EnsuredWrapper<string> Att(string compareValue)
        {
            return new EnsuredWrapper<string>(assertionProvider, compareValue);
        }

        public static CollectionEnsuredWrapper<IEnumerable<TElementType>, TElementType> Att<TElementType>(IEnumerable<TElementType> enumerable) where TElementType : class 
        {
            return new CollectionEnsuredWrapper<IEnumerable<TElementType>, TElementType>(assertionProvider, enumerable);
        }
    }

    public class CollectionEnsuredWrapper<T, TElement> : FluentTests.Framework.CollectionEnsuredWrapper<T,TElement>
        where T : IEnumerable<TElement>
    {
        public CollectionEnsuredWrapper(FluentTests.Framework.IAssertionProvider assertionProvider, T actualValue)
            : base(assertionProvider, actualValue)
        {
        }
    }

    public class EnsuredWrapper<T> : FluentTests.Framework.EnsuredWrapper<T>
    {
        public EnsuredWrapper(FluentTests.Framework.IAssertionProvider assertionProvider, T actualValue)
            : base(assertionProvider, actualValue)
        {
        }

        public Is<T> Är
        {
            get
            {
                return new Is<T>(this);
            }
        }



        public Are<T> Är2
        {
            get
            {
                return new Are<T>(this);
            }
        }

        public Has<T> Har
        {
            get
            {
                return new Has<T>(this);
            }
        }
    }
}
